//
//  CustomNavigationBar.m
//  Lettore RSS Feed
//
//  Created by Dario Trisciuoglio on 09/06/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CustomNavigationBar.h"


@implementation CustomNavigationBar

-(void)drawRect:(CGRect)rect{
	UIImage *image = [[UIImage imageNamed:@"head-iphone.png"] retain];
	[image drawInRect:rect];
	[image release];
}

#pragma mark -
#pragma mark UINavigationDelegate Methods

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
	NSString *title = [viewController title];
	UILabel *myTitleView = [[UILabel alloc] init];
	[myTitleView setFont:[UIFont boldSystemFontOfSize:18]];
	[myTitleView setTextColor:[UIColor clearColor]];
	myTitleView.text = title;
	myTitleView.backgroundColor = [UIColor clearColor];
	[myTitleView sizeToFit];
	viewController.navigationItem.titleView = myTitleView;
	[myTitleView release];
	
	viewController.navigationController.navigationBar.tintColor = [UIColor clearColor];
}

- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
}

@end
